home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / ascii.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  2KB  |  59 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /* ASCII.c */
  21.  
  22. #include <externs.h>
  23.  
  24.  
  25. void AVL_SHOW_ASCII()
  26. {
  27.     AVL_WIN_PTR hw;
  28.     int i, j = 2, k = 2, s = 0;
  29.     char l[10];
  30.     short co;
  31.  
  32.     hw = AVL_MAKE_WINDOW(" ASCII Table ",3,1,24,80,avl_wnd_bk_color,avl_wnd_color);
  33.     co = _settextcolor(avl_men_letter);
  34.     _outtext(" Ch Dec Hex ");
  35.     _outtext("Ch Dec Hex ");
  36.     _outtext("Ch Dec Hex ");
  37.     _outtext("Ch Dec Hex ");
  38.     _outtext("Ch Dec Hex ");
  39.     _outtext("Ch Dec Hex ");
  40.     _outtext("Ch Dec Hex ");
  41.     co = _settextcolor(co);
  42.     for(i = 0; i < 128; ++i)    {
  43.         if (j > 20)  {
  44.             s += 11;
  45.             j = 2;
  46.             }
  47.         _settextposition(j,k+s);
  48.         sprintf(l,"%c  ", i); 
  49.         _outtext(l);
  50.         _settextposition(j,k + 3 + s);
  51.         sprintf(l,"%3d ", i); 
  52.         _outtext(l);
  53.         sprintf(l,"%3x ", i);
  54.         _outtext(l);
  55.         ++j;
  56.         }
  57.     i = getch(); if (i == 0) i = getch();
  58.     AVL_DEL_WINDOW(hw);
  59. }